package com.example.pc.videodemo.ThreadPool

object ThreadPoolFactory {
    var mNormalPool: ThreadPoolProxy? = null
    var mDownLoadPool: ThreadPoolProxy? = null

    /**
     * 得到普通线程池
     *
     */
    val thread: IThread?
        get() {
            return ThreadPool.instance
        }

    /**
     * 得到多线程下载线程池
     *
     */
    val downLoadPool: ThreadPoolProxy?
        get() {
            if (mDownLoadPool == null) {
                synchronized(ThreadPoolProxy::class.java, {
                    if (mDownLoadPool == null) {
                        mDownLoadPool = ThreadPoolProxy(3, 3, 3000)
                    }
                })
            }
            return mDownLoadPool
        }
}